package cn.iocoder.yudao.module.shop.enums;

import cn.hutool.core.util.EnumUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

@AllArgsConstructor
@Getter
public enum ShopItemTimesEnum {
    ADD_GIFT(0, "礼品卡绑定"),
    ADD_RECHARGE (1, "店内充值"),
    ADD_MANUAL (2, "手动增加"),

    SUB_CHECK (3, "店内核销"),
    SUB_MANUAL (4, "手动减少"),
    ;
    /**
     * 类型
     */
    private final Integer type;
    /**
     * 名字
     */
    private final String name;

    public static ShopItemTimesEnum getByType(Integer type) {
        return EnumUtil.getBy(ShopItemTimesEnum.class,
                e -> Objects.equals(type, e.getType()));
    }
}
